/*
 * @Author: 何丽彬
 * @Email: helibin@yingzi.com
 * @Date: 2021-11-19 09:14:33
 * @LastEditTime: 2021-11-19 09:14:33
 * @LastEditors: 何丽彬
 * @FilePath: \process-learn\多进程\work.js
 */
// 工作线程 worker.js
const { parentPort, isMainThread } = require('worker_threads');

parentPort.on('message', () => {
    for(let i = 0;i<1e9;i++) {
        Math.random();
    }
    parentPort.postMessage('done');
})
